﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HZ.MBSM.DBUtility;
public partial class Manage_Note : System.Web.UI.Page
{
    public string strTitle, strContent, strAddDate;
    private string Notid;
    protected void Page_Load(object sender, EventArgs e)
    {
        Notid = SysFun.IsSQL(SysFun.ToTrim(Request.QueryString["Notid"]));
        if (!IsPostBack)
        {
            if (Notid != "" && Notid != null)
            {
                string sql = "select Notid,Title,AddDate,Content,DOWNLOAD from Note ";
                sql += "where Notid=" + Notid;
                Db db = new Db();
                try
                {
                    System.Data.IDataReader dr;
                    dr = db.DataReader(sql);
                    if (dr.Read())
                    {
                        strTitle = dr["Title"].ToString();
                        strContent = dr["Content"].ToString().Replace("\r\n", "<br>");
                        strAddDate = Convert.ToDateTime(dr["AddDate"].ToString()).ToShortDateString();
                        string strDOWNURL = SysFun.ToTrim(dr["DOWNLOAD"].ToString());
                        if (strDOWNURL != "")
                        {
                            Label1.Text = "";
                            foreach (string strId in strDOWNURL.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries))

                                Label1.Text += "&nbsp;&nbsp;<a class=9tw href='../UploadFile/" + strId + "' style='cursor:hand;' ><font size='2'>" + strId.Substring(0, strId.IndexOf(".")) + "</font></a>&nbsp;&nbsp;&nbsp;&nbsp;<br>";
                        }
                        else
                        {
                            Label1.Visible = false;
                        }

                    }
                    dr.Close();
                    dr.Dispose();

                    db.Close();
                }
                catch
                {
                    db.Close();
                }

            }


        }


    }
}
